<script>var ahli_arr = new Array();</script>
<script type="text/javascript">
menuLayers.show = function(id, controller, objid, objname, e) {
    var mnu = document.getElementById? document.getElementById(id): null;
    if (!mnu) return;
    this.activeMenuID = id;
    if ( mnu.onmouseout == null ) mnu.onmouseout = this.mouseoutCheck;
    if ( mnu.onmouseover == null ) mnu.onmouseover = this.clearTimer;
    viewport.getAll();
    rewritePopupContent(controller, objid, objname);

    this.position(mnu,e);
}
</script>

<script>
function confirmAndDelete(url) {
	if (confirm("Adakah Anda Pasti?")) {
		location = url
	}
	
}


function rewritePopupContent(controller, objid, objname) {
    $('popmenu').style.width = 180;
    $('popmenu').innerHTML = "<ul>" + 
					       "<li><a href=\""  + "?act=view_ahli&" + "id=" + objid + "\">&nbsp;&nbsp;Papar Maklumat Ahli</a>" + 

					       "<li><a href=\""  + "?act=edit_ahli&" + "id=" + objid + "\">&nbsp;&nbsp;Edit Maklumat Ahli</a>" + 

<?
if ($_SESSION['ACCESS_LEVEL'] != '5') {
?>
					       "<li><a href=\"javascript: confirmAndDelete('?act=delete_ahli&id=" + objid + "')" + "\">&nbsp;&nbsp;Hapus Rekod Ahli</a>" + 
<? } ?>
					       "<hr size=1><li><a href=\""  + "?act=edit_penyata&" + "id=" + objid + "\">&nbsp;&nbsp;Pembayaran</a>" + 
					       "</ul>"
     
}

function a(id) {
	MM_openBrWindow('/course_implementations/show_timetable2/'+id,'','scrollbars=yes,width=1000,height=600')
}
</script>


        
        <div id="content">
            <div id="content_header" class="size_20" style=" border-bottom-width:medium; border-bottom-style:solid; border-bottom-color:#777777">
            	<img src="images/icn_mytaskTitle.gif" align="absmiddle" width="" height="">Pembayaran Berkelompok </div>
        	<div id="content_bgblue">
                <div id="content_bgwhite">
        
<div id="kandungan" style="border: 0pt solid silver; width: 100%;">

            <? alert_some_message()?>


<form name="search" action="?act=payment_bulk_search" method="POST" target="" onSubmit="" onReset="">
<fieldset style="background:#ffffff; border-width:thin; border-style:solid; padding:10px; border-color:#CCCCCC;">
<legend style="font-size:1.0em; font-weight: bold;">Carian </legend>

<script>
function toggleClear(val) {
	var arr = new Array('q','n','b','l','tm','tb','stop');
	for (i=0;i<arr.length;i++) {
		if (val != arr[i]) {
			document.getElementById(arr[i]).value = '';
		} 
	}
}
</script>
<table border="0" cellpadding="4" cellspacing="1" width="100%">
  <tbody>
    <tr id="SkimRow" style="display: ;">
      <td width="150" align="right" class="TableField"><span class="TableRowLeft">No. Ahli </span></td>
      <td width="10" class="TableField">:</td>
      <td class="TableRowLeft"><input name="n1" type="text" id="n1"  style="width: 100px;" value="<?=$_REQUEST['n1']?>" maxlength="10" onfocus="toggleClear('n');"/> 
        hingga 
          <input name="n2" type="text" id="n2"  style="width: 100px;" value="<?=$_REQUEST['n2']?>" maxlength="10" onfocus="toggleClear('n');"/></td>
      </tr>
    

    
    <tr id="NegeriRow" style="">
      <td width="100" align="right" class="TableField">Cawangan</td>
      <td class="TableField" width="10">:</td>
      <td class="TableRowLeft"><select name="c" id="select" onchange="" style="width: 200px;">
        <option value="">--Semua Cawangan--</option>
        <?
				$combo   = new GUI();
				$options = getOptionsFromTable('cawangan','id_cawangan','cawangan');
				echo $combo->printCombo2($options, "",false, $_REQUEST['c'],false,0);
     	  ?>
      </select>
          <!--input name="prasekolah" type="checkbox" value="t" checked="checked" />
      Prasekolah -->      </td>
      </tr>
    <tr id="NegeriRow" style="">
      <td width="100" align="right" class="TableField">Status Keahlian </td>
      <td class="TableField" width="10">:</td>
      <td class="TableRowLeft"><select name="k" id="select2" onchange="" style="width: 200px;">
        <option value="">--Semua Status--</option>
        <?
				$combo   = new GUI();
				//$options = getOptionsFromTable('status_keahlian','id_keahlian','status');
				$options = getOptionsFromTable('pribadi','keahlian','keahlian');
				echo $combo->printCombo2($options, "",false, $_REQUEST['k'],false,0);
     	  ?>
      </select>
        <!--input name="prasekolah" type="checkbox" value="t" checked="checked" />
      Prasekolah -->      </td>
      </tr>
    
    <tr class="NormalTextLeft">
      <td colspan="3" align="center"><span class="TableRowLeft">
        <input name="button" type="submit" onclick="" value="Cari" style=" width:100px;" />
        <input name="button2" type="reset" onclick="" value="Reset" style=" width:100px;" />
      </span></td>
    </tr>
  </tbody>
</table>
</fieldset>

<br>
</form>

<? if ($res_count > 0) {?>

<table width="100%" border="0" cellspacing="1" cellpadding="2">
              <tr>
                <td align="left" scope="col" style=" font-weight:bold; border-bottom-style:solid; border-bottom-width:thin;">Hasil Carian  : <?=$res_count?> Ahli  </td>
              </tr>
        </table>
			
		<font class="NormalTextLeft"></font> <br>
<br>
<div style=" overflow: ;">

<form name="search" action="?act=payment_bulk_do" method="POST" target="" onSubmit="" onReset="">
<table width="100%" border="0" cellspacing="1" cellpadding="2">
  <tr>
    <td>&nbsp;
        <span style="color:orange;">*maksima <?=$limit?> ahli untuk setiap pembayaran berkelompok</span>           <!--a href="export.php?act=search_sek&amp;params=<?php echo $s_params?>"><img src="images/excel.gif"/></a--></td>
    <td width="40" align="left">&nbsp;</td>
    <td width="60" align="right">&nbsp;</td>
    <td width="40" align="right">&nbsp;</td>
  </tr>
  <tr>
    <td>Tahun: <span class="classRow">
      <select name="sesi_tahun" id="sesi_tahun" onchange="//if (confirm('Are you sure?')) location='?act=payment_bulk_search&<?=$paginate_str?>&sesi_tahun='+this.value + '&month=' + document.getElementById('month').value;">
        <?
				$combo   = new GUI();
				//$options = getOptionsFromTable('ref_negeri','id','negeri');
				for ($i=2009;$i<=$current_year;$i++) {
					$arr[$i] = $i;
				}
				$options = $arr;
				echo $combo->printCombo2($options, "",false, $selected_year, false,0);
			  ?>
      </select>
    </span> Bulan: <span class="classRow">
    <select name="month" id="month" onchange="//if (confirm('Are you sure?'))location='?act=payment_bulk_search&<?=$paginate_str?>&month='+this.value + '&sesi_tahun=' + document.getElementById('sesi_tahun').value;">
      <?
				$combo   = new GUI();
				$arr = array();
				//$options = getOptionsFromTable('ref_negeri','id','negeri');
				for ($i=0;$i<count($irou_months);$i++) {
					$arr["$irou_months[$i]"] = $irou_month_nums[$i];
				}
				$options = $arr;
				echo $combo->printCombo2($options, "",false, $selected_month, false,0);
			  ?>
    </select>
<script>
function go() {
	if (confirm('Are you sure?'))
		location='?act=payment_bulk_search&<?=$paginate_str?>&month='+document.getElementById('month').value + '&sesi_tahun=' + document.getElementById('sesi_tahun').value;
}
</script>
    <input type="button" name="Button2" value="Go" onclick="go();"/>
    </span></td>
    <td align="left">&nbsp;</td>
    <td align="right">&nbsp;</td>
    <td align="right">&nbsp;</td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="1" cellpadding="2" style=" border:thin; border-color:#CCCCCC; border-style:solid;">
    <tr>
      <td width="20" align="center" bgcolor="#999999" scope="col"><span class="style3">Bil</span></td>
      <td align="center" bgcolor="#999999" scope="col" nowrap><a href="#">No Ahli
          <?=$show_img[1]?>
      </a></td>
      <td align="center" bgcolor="#999999" scope="col">Yuran</td>
      <td align="center" bgcolor="#999999" scope="col">Sumba-<br />
        ngan</td>
      <td align="center" bgcolor="#999999" scope="col">Tabung<br />
        Bangunan</td>
      <td align="center" bgcolor="#999999" scope="col">Insuran</td>
      <td align="center" bgcolor="#999999" scope="col">Nama Ahli
          <?=$show_img[2]?>      </td>
      <td align="center" bgcolor="#999999" scope="col"><span class="style3">No KP Baru</span></td>
      <td align="center" bgcolor="#999999" scope="col"><span class="style3">No KP Lama </span></td>
      <td align="center" bgcolor="#999999" scope="col">Cawangan<a href="?act=search_murid&amp;<?=$paginate_str?>&amp;idx=1&amp;sort_asc=<?=$_SESSION['sort_asc']?>&amp;p=<?=$page?>"></a></td>
      <td align="center" bgcolor="#999999" scope="col"><span class="style3">Keahlian</span></td>
      <td width="30" align="center" bgcolor="#999999" scope="col">&nbsp;</td>
    </tr>

<script>
function applyAll() {
	for (i=0;i<ahli_arr.length;i++) {
		document.getElementById('yuran_' + ahli_arr[i]).value = document.getElementById('y').value;
		document.getElementById('sumbangan_' + ahli_arr[i]).value = document.getElementById('s').value;
		document.getElementById('tabung_'   + ahli_arr[i]).value = document.getElementById('t').value;
		document.getElementById('insuran_' + ahli_arr[i]).value = document.getElementById('i').value;
	}
}
</script>
    <tr bgcolor="<?=$bgcolor?>">
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td><input id="y" name="y" type="text" value="<?=$yurans[$month]?>" size="2" maxlength="5" /></td>
      <td><input id="s" name="s" type="text" value="<?=$sumbangan[$month]?>" size="2" maxlength="5" /></td>
      <td><input id="t" name="t" type="text" value="<?=$tabung[$month]?>" size="2" maxlength="5" /></td>
      <td><input id="i" name="i" type="text" value="<?=$insuran[$month]?>" size="2" maxlength="5" /></td>
      <td><input type="button" name="Button" value="Apply" onclick="applyAll();"/></td>
      <td>&nbsp;</td>
      <td align="center" style=" width:80px; overflow:scroll; height:20px;">&nbsp;</td>
      <td align="">&nbsp;</td>
      <td>&nbsp;</td>
      <td align="center">&nbsp;</td>
    </tr>

    <?
$even = true; 
$i = ($page-1)*20;
$i=0;
while ($dat = $res->FetchNextObject()) {
	$dat = decapitalize($dat);
	$i++;
	$even = !$even;
	$bgcolor = ($even)? "":"#E9F0F5";
?>
    <script> ahli_arr.push('<?=$dat->id?>')</script>
    <tr bgcolor="<?=$bgcolor?>" onmouseover="this.style.background='#FFFFCC'" onmouseout="this.style.background='<?=$bgcolor?>'">
      <td><?=$i?><? print_r($dat->fields[0]);?>
        .</td>
      <td><?=strtoupper($dat->no_ahli)?></td>
      <td><input id="yuran_<?=$dat->id?>" name="yuran[<?=$dat->id?>]" type="text" value="<?=$dat->yuran_amount?>" size="2" maxlength="5" /></td>
      <td><input id="sumbangan_<?=$dat->id?>" name="sumbangan[<?=$dat->id?>]" type="text" value="<?=$dat->sumbangan_amount?>" size="2" maxlength="5" /></td>
      <td><input id="tabung_<?=$dat->id?>" name="tabung[<?=$dat->id?>]" type="text" value="<?=$dat->tabung_amount?>" size="2" maxlength="5" /></td>
      <td><input id="insuran_<?=$dat->id?>" name="insuran[<?=$dat->id?>]" type="text" value="<?=$dat->insuran_amount?>" size="2" maxlength="5" /></td>
      <td><?=$dat->nama_ahli?></td>
      <td><?=$dat->nokp_baru?></td>
      <td align="center" style=" width:80px; overflow:scroll; height:20px;"><?=$dat->nokp_lama?></td>
      <td align=""><span style=" width:150px; overflow:scroll; height:20px;">
        <?=$dat->cawangan?>
      </span></td>
      <td><span style=" width:150px; overflow:scroll; height:20px;">
        <?=$dat->keahlian?>
      </span></td>
      <td align="center">&nbsp;</td>
    </tr>
    <? } ?>
  </table>
  <table width="100%" border="0" cellspacing="1" cellpadding="2">
    <tr>
      <td align="right">&nbsp;
          <!--a href="export.php?act=search_sek&amp;params=<?php echo $s_params?>"><img src="images/excel.gif"/></a--></td>
      <td width="40" align="left">&nbsp;</td>
      <td width="60" align="right">&nbsp;</td>
      <td width="40" align="right">&nbsp;</td>
    </tr>
    <tr>
      <td colspan="4" align="center"><span class="TableRowLeft">
        <input type="hidden" name="params" value="<?=$paginate_str?>"/>
        <input name="button3" type="submit" onclick="" value="Simpan" style=" width:100px;" />
      </span></td>
      </tr>
  </table>
</form>
</div>

<table width="100%" border="0" cellspacing="1" cellpadding="2">
  <tr>
    <td>&nbsp;</td>
    <td width="20" align="left"><a href="?act=list_sek&p=<?=$_REQUEST['p']-1?>"></a></td>
    <td align="right" width="100">&nbsp;</td>
    <td width="20" align="right"><a href="?act=list_sek&p=<?=$_REQUEST['p']+1?>"></a></td>
  </tr>
</table>
<!--/fieldset-->
<? }
else {
	if (isset($res_count)) {
		echo "Tiada hasil carian.";	
	}
}
 // end of search result list?>

</div>
<!--div id="content_footborder" style="width:930px; position:absolute; left:0; background:#ccccff; text-align:center">
  &copy; Kementerian Pelajaran Malaysia, 2010.
 </div-->
</div>
<!-- close content_bgwhite -->
</div>
<!-- close content_bgblue -->
</div>
<!-- close content -->

</div>
<!-- close container_content -->

</div>
<!-- close container -->
</body>

<!-- popup menu initial layer----->
<div id="popmenu" class="menu"></div>
<!-- EOpopup menu initial layer----->
